package com.lingxu.base.common.util;

import java.util.regex.Pattern;

/**
 * @Title: RegxUtil
 * @Package: com.lingxu.base.common.util
 * @Author: ysj闫世杰
 * @Email: 1105324813@qq.com
 * @Date: Created in 2021/4/25 17:03
 * @Description: 正则表达式校验
 * @Version: 1.0.0
 */
public final class RegxUtil {

    /**
     * @Author ysj闫世杰
     * @Description 判断是否18/15位数字。
     * @Date 2021/4/25 17:26
     * @Param: card
     * @return boolean
     **/
    public static boolean isCardNumber(String card){
        String REGEX_ID_CARD = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)";
        return Pattern.matches(REGEX_ID_CARD, card);
    }
}
